<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="/statics/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript">
        function addUser(){
            console.log($("#userForm").serializeArray());
            $.post("/user/add",$("#userForm").serializeArray(),function(data){
                //console.log(data)
            })
        }
    </script>
</head>
<body>
<form id="userForm" name="userForm" method="post" action="/user/add">
    <!--div的class 为error是验证错误，ok是验证成功-->
    <div>
        <label for="userCode">用户编码：</label>
        <input type="text" name="userCode" id="userCode" value="10002">
        <!-- 放置提示信息 -->
        <font color="red"></font>
    </div>
    <div>
        <label for="userName">用户名称：</label>
        <input type="text" name="userName" id="userName" value="admin123123">
        <font color="red"></font>
    </div>
    <div>
        <label for="userPassword">用户密码：</label>
        <input type="password" name="userPassword" id="userPassword" value="123123">
        <font color="red"></font>
    </div>
    <div>
        <label for="ruserPassword">确认密码：</label>
        <input type="password" name="ruserPassword" id="ruserPassword" value="123123">
        <font color="red"></font>
    </div>
    <div>
        <label >用户性别：</label>
        <select name="gender" id="gender">
            <option value="1" selected="selected">男</option>
            <option value="2">女</option>
        </select>
    </div>
    <div>
        <label for="birthday">出生日期：</label>
        <input type="text" Class="Wdate" id="birthday" name="birthday" value="2020/01/01">
        <font color="red"></font>
    </div>
    <div>
        <label for="phone">用户电话：</label>
        <input type="text" name="phone" id="phone" value="15147787745">
        <font color="red"></font>
    </div>
    <div>
        <label for="address">用户地址：</label>
        <input name="address" id="address"  value="成都">
    </div>
    <div>
        <label >用户角色：</label>
        <!-- 列出所有的角色分类 -->
        <select name="userRole" id="userRole">
            <option value="1">超管</option>
            <option value="2">经理</option>
            <option value="3">普通员工</option>
        </select>
        <font color="red"></font>
    </div>
    <div class="providerAddBtn">
       <input type="submit">
        <input type="button" name="add" id="add" value="保存2" onclick="addUser()" >
    </div>
</form>

</body>

</html>
